﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SeaBattle.Domain.Entities.Game>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Sea Battle Room
    <%:Model.Name %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script src="<%:Url.Content("~/Scripts/Game/Game.js")%>" type="text/javascript"></script>
    <script type="text/javascript">
   $(document).ready(function() {
   var refreshId = setInterval(function() {
    if($("#opponentName").length == 0)
    {
      $("#opponentInfo").load('/Room/Opponent/' + <%:Model.Id%>);
    }
   }, 3000);
   });
    </script>
    <div id="gameInfo">
        <h2>
            <%:Model.Name %></h2>
        <h3>
            Creator:
            <%:Model.Creator.Login %></h3>
        <h3>
            Opponent:
            <%Html.RenderAction("Opponent", new { id = Model.Id });%>
        </h3>
        <h4>
            Preset:
            <%:Model.Preset %></h4>
    </div>
    <a class="backLink" href="<%:Url.Action("Index","Lobby") %>">К списку игр</a>
</asp:Content>
